<!--
 *@开发者: 刘翔
 *@创建时间: 2024-04-28 11:52:21
 *@描述:病组结余TOP10
!-->
<template>
	<div class="page-tile-20">
		<div class="page-tile-20-center">
			<formList
				v-if="typeValue === '全院'"
				topHeightValue="10%"
				bottomHeightValue="90%"
				:formParameter="formParameter"
				:data_list="data_list"
			/>
			<formList1
				v-else
				topHeightValue="15%"
				bottomHeightValue="85%"
				:formParameter="formParameter1"
				:data_list="data_list"
			/>
		</div>
		<div class="page-tile-20-bottom">
			<span v-html="card1.text1"></span>
		</div>
	</div>
</template>

<script>
import formList from '../components/formList/formList'
import formList1 from '../components/formList/formList1'

export default {
	// 组件名称
	name: 'pageTile20',
	// 组件参数 接收来自父组件的数据
	props: {},
	// 局部注册的组件
	components: {
		formList,
		formList1
	},
	// 组件状态值
	data () {
		return {
			card1: {},
			data_list: [],
			typeValue: "",
			formParameter: [
				{ width: '8%', title: "病组编码" },
				{ width: '20%', title: "病组名称" },
				{ width: '5%', title: "CMI" },
				{ width: '6%', title: "病例数" },
				{ width: '6%', title: "例均医保拨付费用" },
				{ width: '6%', title: "本院例均费用", highlightValue: "本院例均费用是否标红" },
				{ width: '6%', title: "例均盈亏" },
				{ width: '6%', title: "地区均费" },
				{ width: '6%', title: "平均住院日" },
				{ width: '6%', title: "高倍率占比(%)", highlightValue: "高倍率占比是否标红" },
				{ width: '6%', title: "低倍率占比(%)", highlightValue: "低倍率占比是否标红" },
				{ width: '6%', title: "药品费占比", highlightValue: "药占比是否标红" },
				{ width: '6%', title: "材料费占比", highlightValue: "耗占比是否标红" },
				{ width: '7%', title: "合计盈亏(万元)", highlightValue: "合计盈亏(万元)是否标红" }],
			formParameter1: {
				leftList: {
					widthValue: "30%",
					titleList: [{
						width: '20%',
						title: "病组编码",
					},
					{
						width: '80%',
						title: "病组名称",
					}]
				},
				rightList: {
					widthValue: "70%",
					titleList: {
						"病例数": [{
							width: '50%',
							title: "同期病例数",
							customTitle: "同期"
						},
						{
							width: '50%',
							title: "病例数",
							customTitle: "本期",
							bkColorHighlightValue: "病例数同比颜色",
						}],
						"例均费用": [{
							width: '50%',
							title: "同期例均费用",
							customTitle: "同期"
						},
						{
							width: '50%',
							title: "例均费用",
							customTitle: "本期",
							bkColorHighlightValue: "例均费用同比颜色",
						}],
						"例均盈亏": [{
							width: '50%',
							title: "同期例均盈亏",
							customTitle: "同期"
						},
						{
							width: '50%',
							title: "例均盈亏",
							customTitle: "本期",
							bkColorHighlightValue: "例均盈亏同比颜色",
						}],
						"地区均费": [{
							width: '50%',
							title: "同期地区均费",
							customTitle: "同期"
						},
						{
							width: '50%',
							title: "地区均费",
							customTitle: "本期",
							bkColorHighlightValue: "地区均费同比颜色",
						}],
						"平均住院日": [{
							width: '50%',
							title: "同期平均住院日",
							customTitle: "同期"
						},
						{
							width: '50%',
							title: "平均住院日",
							customTitle: "本期",
							bkColorHighlightValue: "平均住院日同比颜色",
						}],
						"合计盈亏": [{
							width: '50%',
							title: "同期合计盈亏(万元)",
							customTitle: "同期",
						},
						{
							width: '50%',
							title: "合计盈亏(万元)",
							customTitle: "本期",
							bkColorHighlightValue: "合计盈亏(万元)同比颜色",
						}],
					}
				},
			}
		}
	},
	// 计算属性
	computed: {},
	// 侦听器
	watch: {},
	// 组件方法
	methods: {
		init (data, typeValue) {
			this.typeValue = typeValue;
			this.data_list = data.data_list;
			this.data_list.forEach(item => {
				if (item['合计盈亏(万元)']) item['合计盈亏(万元)是否标红'] = item['合计盈亏(万元)'] < 0 ? true : false
			})
			//内容
			this.cardData(data.desc);
		},
		//卡片内容
		cardData (desc) {
			this.card1 = {
				text1: desc,
			}
		}
	},
	created () {
	},
	mounted () {
	},
}
</script>

<style lang="less" scoped>
	.page-tile-20 {
		height: 100%;
		.page-tile-20-center {
			margin-bottom: 30px;
			height: 82%;
		}
		.page-tile-20-bottom {
			margin: 0 20px;
			padding: 2%;
			display: flex;
			align-items: center;
			height: 12%;
			font-size: 1.7rem;
			line-height: 40px;
			background: #fff2ca;
			border-radius: 16px;
			border: 1px solid #000;
		}
	}
</style>
